/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.oea.hibernate.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author unnati
 */
@Table(name = "branches")
@Entity
public class Branch extends AbstractEntity {

    @Column(name = "name")
    private String name;
    
    @Column(name = "addedby")
    private Long addedby;
    
    @Id
    @Column(name = "id")
    @GeneratedValue
    private Long id;
    
    @Transient
    private Admin admin;

    public Admin getAdmin() {
        return admin;
    }

    public void setAdmin() {
        this.admin = (Admin) new  Admin().getById(addedby);
    }
    

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getAddedby() {
        return addedby;
    }

    public void setAddedby(Long addedby) {
        this.addedby = addedby;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

}
